package com.shell.provider;

import com.shell.bee.base.annotation.Logging;
import com.shell.bee.base.utils.StringUtil;
import com.shell.bee.mvc.controller.BaseController;
import com.shell.provider.message.service.MsgTipService;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class MsgTipProvider extends BaseController {
	@Autowired
	private MsgTipService msgTipService;

	@RequestMapping({ "/getMsgTip" })
	@Logging(methods = "������������")
	@ResponseBody
	public Map<String, Object> getMsgTip(String key, String cusId) throws Exception {
		Map<String, Object> data = new HashMap();
		if ((StringUtil.emptyAndNull(key)) || ("acct-trial".equals(key))) {
			data.put("acct-trial", Integer.valueOf(this.msgTipService.getMsgCountForAcctTrial(cusId)));
		}
		if ((StringUtil.emptyAndNull(key)) || ("acct-final".equals(key))) {
			data.put("acct-final", Integer.valueOf(this.msgTipService.getMsgCountForAcctFinal(cusId)));
		}
		if ((StringUtil.emptyAndNull(key)) || ("cus-trial".equals(key))) {
			data.put("cus-trial", Integer.valueOf(this.msgTipService.getMsgCountForCusModifyTrial(cusId)));
		}
		if ((StringUtil.emptyAndNull(key)) || ("cus-final".equals(key))) {
			data.put("cus-final", Integer.valueOf(this.msgTipService.getMsgCountForCusModifyFinal(cusId)));
		}
		if ((StringUtil.emptyAndNull(key)) || ("first-trial".equals(key))) {
			data.put("first-trial", Integer.valueOf(this.msgTipService.getMsgCountForCusTrial(cusId)));
		}
		if ((StringUtil.emptyAndNull(key)) || ("last-trial".equals(key))) {
			data.put("last-trial", Integer.valueOf(this.msgTipService.getMsgCountForCusFinal(cusId)));
		}
		return data;
	}
}
